package a_airwar;

public class Airplane extends FlyObj implements Enemy {

    private int speed;
    private int score;
   /* public Airplane() {
        image = JFrameMain.airplane;
        width = image.getWidth();
        height = image.getHeight();
        x = (int) (Math.random() * JFrameMain.Width);
        y = -image.getHeight();
        speed = 10;
        blood = 3;
    }*/

    public Airplane() {
        //使用private修饰之后 所有的成员变量都访问不到
        //只能使用super关键词调用 - 调用父类的构造方法

        super((int) (Math.random() * JFrameMain.Width),
                JFrameMain.airplane.getHeight(),
                JFrameMain.airplane,
                2);
        speed = 5;
        score = 3;
    }


    @Override
    public void move() {
        /* y += speed;*/
        this.setY(this.getY() + speed);
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getScore() {
        return score;
    }


}
